home *** CD-ROM | disk | FTP | other *** search
-
- /* File : floodfil.c */
- /* Entered by : A. Wayner */
- # include <graphics.h>
- # include <stdlib.h>
-
-
- main()
- {
- int graphdriver = DETECT, graphmode;
-
- /* Detect adapter type and initialize */
- /* graphics system */
- initgraph( &graphdriver, &graphmode, "\\turboc" );
- outtextxy( 10, 10, "Demonstrating floodfill");
-
- /* First draw a rectangle with a white */
- /* border and a solid fill style */
- setlinestyle( USERBIT_LINE, 0xffff, THICK_WIDTH );
- setcolor( WHITE );
- rectangle( 0, 50, 100, 100 );
-
- /* Now use floodfill to fill the interior */
- /* with red */
- setfillstyle( SOLID_FILL, LIGHTCYAN );
- floodfill( 25, 75, WHITE );
- outtextxy( 10, 20, grapherrormsg( graphresult() ));
-
- /* Wait until user presses a key */
- outtextxy( 10, getmaxy() - 30, "Press any key to exit");
-
- getch();
- closegraph();
- }
-
-